package com.ruoyi.gis.task;

import com.aliyun.aiearth_engine20220609.models.ListDatasResponseBody;
import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.framework.task.AbstractTask;
import com.ruoyi.framework.task.TaskResult;
import com.ruoyi.gis.service.IDatasetRasterService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;

public class EarthAiTask extends AbstractTask {
    private final Logger logger = LoggerFactory.getLogger(EarthAiTask.class);
    private IDatasetRasterService datasetRasterService;
    private List<ListDatasResponseBody.ListDatasResponseBodyList> data;
    public EarthAiTask(List<ListDatasResponseBody.ListDatasResponseBodyList> data) {
        this.data = data;
    }
    @Override
    public TaskResult call() throws Exception {
        TaskResult result = new TaskResult();
        datasetRasterService = SpringUtils.getBean(IDatasetRasterService.class);
        datasetRasterService.addDatasetRaster(data);
        return result;
    }
}
